home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / gnudiff / Makefile < prev    next >
Encoding:
Makefile  |  1995-06-28  |  3.5 KB  |  110 lines

  1. # Makefile for GNU DIFF
  2. # Copyright (C) 1988, 1989 Free Software Foundation, Inc.
  3.  
  4. # This file is part of GNU DIFF.
  5.  
  6. # GNU DIFF is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 1, or (at your option)
  9. # any later version.
  10. # GNU DIFF is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with GNU DIFF; see the file COPYING.  If not, write to
  16. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. # You can compile this with ordinary cc as well,
  19. # but gcc makes it faster.
  20. # Also, gcc supports -O and -g together.
  21. # CC=gcc -O
  22. # CFLAGS = -g
  23. # INSTALL = install
  24.  
  25. # On system V, enable these three lines:
  26. CC = cc -dy
  27. CFLAGS = -O -DUSG
  28. LIBS = -lPW -lmalloc
  29. INSTALL = bsdinstall -s
  30. # (If you compile with GCC, you don't need to define LIBS.)
  31. # And, depending on the names and contents of your header files,
  32. # add either -DHAVE_NDIR or -DHAVE_DIRECT or both to CFLAGS.
  33. # Add -DHAVE_NDIR to CFLAGS if your system used ndir.h instead of dirent.h
  34. # Add -DHAVE_DIRECT to CFLAGS if your system uses 'struct direct' instead of
  35. # 'struct dirent' (this is the case at least with one add-on ndir library).
  36.  
  37. # Use these definitions for XENIX:
  38. # There are rumors of bugs in various Xenix's dirent.h and -ldir.  As
  39. # a result, we suggest using HAVE_NDIR and not using -ldir.
  40. # CFLAGS = -O -DUSG -DXENIX -DHAVE_NDIR -DHAVE_DIRECT -DNDIR_IN_SYS
  41. # LIBS = -lx -lPW
  42. # INSTALL = cp
  43.  
  44. # Some System V machines do not come with libPW.  If this is true, use
  45. # the GNU alloca by switching the comment on the following lines.
  46. ALLOCA = 
  47. # ALLOCA = $(archpfx)/alloca.o
  48.  
  49. bindir=/usr/skunk/bin
  50. prefix=
  51.  
  52. # All source files
  53. srcs=diff.c analyze.c io.c context.c ed.c normal.c ifdef.c util.c dir.c \
  54.     version.c diff.h regex.c regex.h limits.h diff3.c \
  55.     getopt.c getopt1.c getopt.h alloca.c
  56. # Object files for diff only.
  57. objs=$(archpfx)diff.o $(archpfx)analyze.o $(archpfx)io.o $(archpfx)context.o \
  58.      $(archpfx)ed.o $(archpfx)normal.o $(archpfx)util.o $(archpfx)dir.o \
  59.      $(archpfx)regex.o $(archpfx)ifdef.o $(archpfx)version.o \
  60.      $(archpfx)getopt.o $(archpfx)getopt1.o
  61. tapefiles = $(srcs) README diagmeet.note Makefile COPYING ChangeLog
  62.  
  63. all: $(archpfx)diff $(archpfx)diff3
  64.  
  65. $(archpfx)diff3: $(archpfx)diff3.o
  66.     $(CC) -o $(archpfx)diff3 $(CFLAGS) $(LDFLAGS) $(archpfx)diff3.o $(LIBS)
  67.  
  68. $(archpfx)diff: $(objs)
  69.     $(CC) -o $(archpfx)diff $(CFLAGS) $(LDFLAGS) $(objs) $(LIBS)
  70.  
  71. $(objs): diff.h
  72.  
  73. $(archpfx)context.o $(archpfx)diff.o: regex.h
  74.  
  75. $(archpfx)diff3.o: diff3.c
  76.     $(CC) -c $(CFLAGS) -DDIFF_PROGRAM=\"$(bindir)/gnudiff\" diff3.c \
  77.  $(OUTPUT_OPTION)
  78.  
  79. clean:
  80.     rm -f *.o $(archpfx)diff $(archpfx)diff3 diff.tar diff.tar.Z
  81.  
  82. install: install-diff install-diff3
  83.  
  84. install.man:
  85.  
  86. install-diff: $(prefix)$(bindir)/gnudiff
  87.  
  88. $(prefix)$(bindir)/gnudiff: $(archpfx)diff
  89.     $(INSTALL) $(archpfx)diff $(prefix)$(bindir)/gnudiff
  90.  
  91. install-diff3: $(prefix)$(bindir)/gnudiff3
  92.  
  93. $(prefix)$(bindir)/gnudiff3: $(archpfx)diff3
  94.     $(INSTALL) $(archpfx)diff3 $(prefix)$(bindir)/gnudiff3
  95.  
  96. diff.tar: $(tapefiles)
  97.     mkdir tmp
  98.     mkdir tmp/diff
  99.     -ln $(tapefiles) tmp/diff
  100.     for file in $(tapefiles); do \
  101.         if [ ! -r tmp/diff/$$file ]; then cp $$file tmp/diff; fi \
  102.     done
  103.     cd tmp; tar cf ../diff.tar diff
  104.     rm -rf tmp
  105.  
  106. diff.tar.Z: diff.tar
  107.     compress < diff.tar > diff.tar.Z
  108.